package net.chathu.airgw.packets.chat 
{
	import net.chathu.airgw.model.PrivateChatInfo;
	/**
	 * ...
	 * @author ze
	 */
	public class IAddPrivate extends ChatPacket 
	{
		
		public function IAddPrivate() 
		{
			
		}
		
		override public function execute():void
		{
			var pos:int =(data[7]).indexOf('/',0) +1;
			var private_id:int=parseInt(data[7].substring(pos));
			var partner_id:int=parseInt(data[5]);
			var close_id:int=parseInt(data[2]);
			
			trace("Uj privat beszelgetes!");
			var privInfo:PrivateChatInfo = sessionData.chatData.getPrivateChatInfo(private_id);
			if (!privInfo)
			{
				privInfo = new PrivateChatInfo(private_id, partner_id, close_id);
				sessionData.chatData.privateChats.push(privInfo);
			} else {
				trace("MAR LETEZIK EZ A PRIVAT BESZELGETES! privateId: " + private_id);
				
			}
		}
	}
}